Remove collateOnly() from ProfilerStandard and subclasses
authorChad Horohoe <chadh@wikimedia.org>
Thu, 30 Oct 2014 22:18:22 +0000 (15:18 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Thu, 30 Oct 2014 22:46:57 +0000 (15:46 -0700)
All implementations had this set to true, so remove the needless
abstraction and function calls. Child classes that do want to
differentiate here can just set the member variable on construction.

Change-Id: I81a4e6605bdec1fc1a977b5aa1ee1c5853d5ca5b

includes/profiler/ProfilerSimpleDB.php
includes/profiler/ProfilerSimpleText.php
includes/profiler/ProfilerSimpleTrace.php
includes/profiler/ProfilerSimpleUDP.php
includes/profiler/ProfilerStandard.php

index 7ef0ad0..5e62f7c 100644 (file)
  * @ingroup Profiler
  */
 class ProfilerSimpleDB extends ProfilerStandard {
-       protected function collateOnly() {
-               return true;
-       }
-
        public function isPersistent() {
                return true;
        }
index 0ee7aad..2d96b88 100644 (file)
@@ -42,10 +42,6 @@ class ProfilerSimpleText extends ProfilerStandard {
                parent::__construct( $profileConfig );
        }
 
-       protected function collateOnly() {
-               return true;
-       }
-
        public function logData() {
                if ( $this->mTemplated ) {
                        $this->close();
index 2a44494..95e4bc6 100644 (file)
@@ -30,10 +30,6 @@ class ProfilerSimpleTrace extends ProfilerStandard {
        protected $trace = "Beginning trace: \n";
        protected $memory = 0;
 
-       protected function collateOnly() {
-               return true;
-       }
-
        public function profileIn( $functionname ) {
                parent::profileIn( $functionname );
 
index 627b4de..02405af 100644 (file)
  * @ingroup Profiler
  */
 class ProfilerSimpleUDP extends ProfilerStandard {
-       protected function collateOnly() {
-               return true;
-       }
-
        public function isPersistent() {
                return true;
        }
index cc13416..a65e53e 100644 (file)
@@ -40,8 +40,8 @@ class ProfilerStandard extends Profiler {
        protected $mCollated = array();
        /** @var bool */
        protected $mCollateDone = false;
-       /** @var bool */
-       protected $mCollateOnly = false;
+       /** @var bool Whether to collect the full stack trace or just aggregates */
+       protected $mCollateOnly = true;
        /** @var array Cache of a standard broken collation entry */
        protected $mErrorEntry;
 
@@ -51,8 +51,6 @@ class ProfilerStandard extends Profiler {
        public function __construct( array $params ) {
                parent::__construct( $params );
 
-               $this->mCollateOnly = $this->collateOnly();
-
                $this->addInitialStack();
        }
 
@@ -75,18 +73,6 @@ class ProfilerStandard extends Profiler {
                return false;
        }
 
-       /**
-        * Whether to internally just track aggregates and ignore the full stack trace
-        *
-        * Only doing collation saves memory overhead but limits the use of certain
-        * features like that of graph generation for the debug toolbar.
-        *
-        * @return bool
-        */
-       protected function collateOnly() {
-               return false;
-       }
-
        /**
         * Add the inital item in the stack.
         */